home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / vioscrol.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  2.5 KB  |  105 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "vio.h"
  12.  
  13. #pragma argsused
  14. //
  15. //    Scrolling Down
  16. //
  17. //    Known bugs : Does not take account of the character to use
  18. //
  19. USHORT _APICALL
  20. VioScrollDn ( unsigned short TopRow,
  21.               unsigned short LeftCol,
  22.               unsigned short BotRow,
  23.               unsigned short RightCol,
  24.               unsigned short Lines,
  25.               unsigned char far *PtrCell,
  26.               unsigned short VioHanedle)
  27. {
  28.     volatile unsigned char far *BIOSrows = (volatile unsigned char far *)MK_FP(0x0040, 0x0084) ;
  29.  
  30.     if (Lines == 0) return ERROR_VIO_INVALID_PARMS ;
  31.     if (BotRow == (USHORT)-1) BotRow = *(BIOSrows) + 1 ;
  32.     if (RightCol == (USHORT)-1) RightCol = VioDosScreenMode() >> 8 ;
  33.  
  34.     if (Lines == (USHORT)-1) Lines = 0 ;    // Translate OS/2 to BIOS convention
  35.  
  36.     _BH = PtrCell[1] ;                // Attribute
  37.     _AH = 0x07 ;
  38.     _AL = Lines ;
  39.     _CH = TopRow ;
  40.     _CL = LeftCol ;
  41.     _DH = BotRow ;
  42.     _DL = RightCol ;
  43.     geninterrupt(0x10) ;
  44.     return NO_ERROR ;
  45. }
  46.  
  47. #pragma argsused
  48. //
  49. //    Scrolling Up
  50. //
  51. //    Known bugs : Does not take account of the character to use
  52. //
  53. USHORT _APICALL
  54. VioScrollUp ( unsigned short TopRow,
  55.               unsigned short LeftCol,
  56.               unsigned short BotRow,
  57.               unsigned short RightCol,
  58.               unsigned short Lines,
  59.               unsigned char far *PtrCell,
  60.               unsigned short VioHandle)
  61. {
  62.     volatile unsigned char far *BIOSrows = (volatile unsigned char far *)MK_FP(0x0040, 0x0084) ;
  63.  
  64.     if (Lines == 0) return ERROR_VIO_INVALID_PARMS ;
  65.     if (BotRow == (USHORT)-1) BotRow = *(BIOSrows) + 1 ;
  66.     if (RightCol == (USHORT)-1) RightCol = VioDosScreenMode() >> 8 ;
  67.  
  68.     if (Lines == (USHORT)-1) Lines = 0 ;    // Translate OS/2 to BIOS convention
  69.  
  70.     _BH = PtrCell[1] ;                // Attribute
  71.     _AH = 0x06 ;
  72.     _AL = Lines ;
  73.     _CH = TopRow ;
  74.     _CL = LeftCol ;
  75.     _DH = BotRow ;
  76.     _DL = RightCol ;
  77.     geninterrupt(0x10) ;
  78.     return NO_ERROR ;
  79. }
  80.  
  81. #pragma argsused
  82. //
  83. //    Scrolling Left
  84. //
  85. USHORT _APICALL
  86. VioScrollLf ( unsigned short,
  87.               unsigned short,
  88.               unsigned short,
  89.               unsigned short,
  90.               unsigned short,
  91.               unsigned char far *,
  92.               unsigned short );
  93.  
  94. #pragma argsused
  95. //
  96. //    Scrolling Right
  97. //
  98. USHORT _APICALL
  99. VioScrollRt ( unsigned short,
  100.               unsigned short,
  101.               unsigned short,
  102.               unsigned short,
  103.               unsigned short,
  104.               unsigned char far *,
  105.               unsigned short );